package generated1.OneToMany;

// Generated 9-apr-2009 16.17.55 by Hibernate Tools 3.2.2.GA

import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * Child generated by hbm2java
 */
@Entity
@Table(name = "CHILD")
@SequenceGenerator(name = "Child_seq", sequenceName = "CHILD_SEQ")
public class Child implements java.io.Serializable {

	private BigDecimal id;
	private Parent parent;
	private BigDecimal parentId;

	public Child() {
	}

	public Child(BigDecimal id, Parent parent) {
		this.id = id;
		this.parent = parent;
	}

	public Child(BigDecimal id, Parent parent, BigDecimal parentId) {
		this.id = id;
		this.parent = parent;
		this.parentId = parentId;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "Child_seq")
	@Column(name = "ID", unique = true, nullable = false, scale = 0)
	public BigDecimal getId() {
		return this.id;
	}

	public void setId(BigDecimal id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID", unique = true, nullable = false, insertable = false, updatable = false)
	public Parent getParent() {
		return this.parent;
	}

	public void setParent(Parent parent) {
		this.parent = parent;
	}

	@Column(name = "PARENT_ID", scale = 0)
	public BigDecimal getParentId() {
		return this.parentId;
	}

	public void setParentId(BigDecimal parentId) {
		this.parentId = parentId;
	}

}
